const path = require('path');
const webpack = require('webpack');

function resolve(dir) {
	return path.join(__dirname, dir);
}

module.exports = {
	productionSourceMap: false,
	outputDir: 'dist',
	publicPath: './',
	devServer: {
		port: 3002,
		host: '0.0.0.0',
		https: false,
		open: true
	},
	// configureWebpack: {
	// 	plugins: [
	// 		new webpack.ProvidePlugin({
	// 			$: "jquery",
	// 			jQuery: "jquery",
	// 			"windows.jQuery": "jquery"
	// 		})
	// 	]
	// },
	css: {
	    loaderOptions: {
	      sass: {
	        prependData: `@import "./src/styles/global.scss";`
	       }
	    }
	  },
	lintOnSave: true,
	chainWebpack: (config) => {
		config.resolve.alias
			.set('@$', resolve('src'))
			.set('components', resolve('src/components'))
			.set('assets', resolve('src/assets'))
			.set('api', resolve('src/api'))
			.set('utils', resolve('src/utils'))
			.set('styles', resolve('src/styles'))
	}
}
